package com.syl.practice.globalexception.exception;

import com.syl.practice.globalexception.enums.ApiEnum;
import lombok.Data;

@Data
public class ApiException extends RuntimeException {
    private int code;
    private String msg;

    public ApiException(ApiEnum apiEnum) {
        this.code = apiEnum.getCode();
        this.msg = apiEnum.getName();
    }

    public ApiException(ApiEnum apiEnum, String msg) {
        this.code = apiEnum.getCode();
        this.msg = msg;
    }
}
